package com.zqt.zqt805.controller;

import com.zqt.zqt805.service.ReviewService;
import com.zqt.zqt805.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "评论管理接口---张淇童0805")
@RestController
@RequestMapping("/api/reviews")
public class ReviewController {

    @Autowired
    private ReviewService reviewService;

    @ApiOperation(value = "获取评论信息", notes = "获取指定评论的详细信息")
    @GetMapping("/{reviewId}")
    public AjaxResult getReview(@ApiParam(value = "评论ID", required = true) @PathVariable int reviewId) {
        return AjaxResult.success(reviewService.getReview(reviewId));
    }
}